#include <iostream>

using namespace std;

int main(void)
{
    //水仙花数
    //指一个3位数，它的各个位上的数字的3次幂之和等于它本身

    int num1 = 99;
    int a = 0;
    int b = 0;
    int c = 0;

    do
    {
        num1++;
        a = num1 % 10;
        b = (num1 / 10) % 10;
        c = num1 / 100;
        if (a * a * a + b * b * b + c * c * c == num1)
        {
            cout << num1 << endl;
        }
    } while (num1 != 999);

    return 0;
}